<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style outline-style2">
    <div class="Showroom-parent" v-if="props.info.digitalShowroom">
      <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
    </div>
    <img
      class="outline-parent-bg"
      v-if="props.info.value"
      :src="publicUrls + 'free/style13/Level1outlineStyle3Bg.webp'"
      alt=""
    />
    <img v-else class="outline-parent-bg" :src="publicUrls + 'free/style13/Level1outlineStyle3Bg2.webp'" alt="" />
    <div class="outline jy-style-height">
      <div
        class="content-tiitle"
        :style="!props.info.subTitle && !props.info.remarks && { justifyContent: 'center', alignItems: 'center' }"
      >
        <div class="outline-text1" v-if="props.info.text.length >= 5">
          {{ props.info.text.slice(0, -4) }}
        </div>
        <div class="outline-text">
          <p v-for="(item, index) in props.info.text.slice(-4)" :key="index">{{ item }}</p>
        </div>
        <p class="outline-subTitle" v-if="props.info.subTitle">
          {{ props.info.subTitle }}
        </p>
        <TextMax
          :data="props.info.remarks"
          :infoData="props.info"
          :title="props.info.text"
          :row="
            props.info.text.length >= 5 && props.info.subTitle
              ? 4
              : props.info.text.length < 5 && props.info.subTitle
              ? 5
              : !props.info.subTitle && 6
          "
        ></TextMax>
      </div>
      <div
        class="outline-content"
        v-if="props.info.value"
        @click="ImgVisible = true"
        @mouseenter="flag = true"
        @mouseleave="flag = false"
      ></div>
    </div>
    <div class="outline-content" :class="flag && 'outline-content-hover'">
      <div class="cover" v-if="props.info.value" @click="ImgVisible = true">
        <img class="outline-cover" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
      </div>
    </div>

    <img class="shadow" :src="publicUrls + 'free/style8/firstLevelOutline1Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free13Style3',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style13.vue';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRoute } from 'vue-router';

const ImgVisible = ref(false);
const store = useProjectStore();
const flag = ref(false);
const route = useRoute();

const props = defineProps({
  info: {
    type: Object,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 90px;
  margin-top: 0;
  margin-left: 120px;
  .Showroom-parent {
    position: absolute;
    top: 88px;
    right: 48px;
    z-index: 23;
  }
  .shadow {
    width: 776px;
    height: 200px;
    position: absolute;
    bottom: -30px;
    left: 0;
  }
}
.outline-parent-bg {
  width: 591px;
  height: 100%;
  position: relative;
  z-index: 20;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  padding: 81px 48px 0 31px;
}

.content-tiitle {
  width: 100%;
  height: 364px;
  position: relative;
  display: flex;
  flex-direction: column;
  .outline-text1 {
    font-family: SourceHanSerifCN-Bold;
    font-size: 32px;
    color: #333333;
    line-height: 48px;
  }
  .outline-text {
    width: 432px;
    margin-left: -20px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    ::v-deep p {
      font-family: Slidexiaxing;
      font-size: 90px;
      color: #333333;
      line-height: 108px;
    }
  }
  .outline-subTitle {
    width: 384px;
    color: #000000;
    text-align: left;
    font-family: 'SourceHanSerifCN';
    font-size: 18px;
    line-height: 28px;
    margin-bottom: 16px;
    opacity: 0.8;
  }
}
.outline-content-hover .cover {
  img {
    transform: scale(1.5);
  }
}
.outline-content {
  width: 100%;
  height: 426px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: 0;
  z-index: 1;
  .cover {
    width: 100%;
    flex: 1;
    background: #c4c4c4;
    overflow: hidden;
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: all 0.3s ease;
    }
  }
}

::v-deep .textMore-box {
  width: 384px;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.6) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ff0505 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>